"use strict";
/* Controllers */
app.controller("xinghuoKanbanController", ['$scope', '$location', '$rootScope', '$routeParams', 'xinghuoKanbanService', function ($scope, $location, $rootScope, $routeParams, xinghuoKanbanService) {

    var vm = $scope.vm = {};

    vm.p = {};
    vm.result = {};
    vm.p.id = $routeParams.id;
    vm.p.url = '';

    $scope.loadUrl = function (id) {
        var vm = $scope.vm;
        var idxUrl = function(id) {
            if (id == null) {
                return "-";
            }
            switch (id) {
                case "1":// 数据源拆分zpsrc监控
                    return "https://wuba.xinghuo.58.com/visualization/share/5833";
                    break;
                    break;
                case "2":// HRG数据治理日报
                    return "https://wuba.xinghuo.58.com/visualization/share/5248";
                    break;
                case "3":// HRG数据治理周报
                    return "https://wuba.xinghuo.58.com/visualization/share/5239";
                    break;
                case "4":// 风控周报v1.3 风控数据看板
                    return "https://wuba.xinghuo.58.com/visualization/share/13212?api_params=%7B%22appid%22%3A211%2C%22appsign%22%3A%22ba8cf5befabe3d7f08d77e756917d82f%22%7D&filter_params=%7B%7D&dataset_params=%5B%5D";
                    break;
                case "5":// 用户维度分析
                    return "https://wuba.xinghuo.58.com/visualization/share/13561?api_params=%7B%22appid%22%3A211%2C%22appsign%22%3A%22b947f32ffc7c92c9ae7740e46d3e7070%22%7D&filter_params=%7B%7D&dataset_params=%5B%5D";
                    break;
                case "51":// 流量调控看板，流量趋势看板
                    return "https://wuba.xinghuo.58.com/visualization/share/15155?api_params=%7B%22appid%22%3A211%2C%22appsign%22%3A%22efe08b3af25fe3fd03dc9f759b2940ee%22%7D&filter_params=%7B%7D&dataset_params=%5B%5D";
                    break;
                case "52":// 效果调控看板，客户效果看板
                    return "https://wuba.xinghuo.58.com/visualization/share/15156?api_params=%7B%22appid%22%3A211%2C%22appsign%22%3A%225db5a71746574bb60527e00895bfa314%22%7D&filter_params=%7B%7D&dataset_params=%5B%5D";
                    break;
                case "6":// 930新三类离线看板
                    return "https://wuba.xinghuo.58.com/visualization/share/13652?api_params=%7B%22appid%22%3A211%2C%22appsign%22%3A%229b583ee7ba801b2ec76887dad7e2c3a8%22%7D&filter_params=%7B%7D&dataset_params=%5B%5D";
                    break;
                case "7":// 930新三类实时看板
                    return "https://wuba.xinghuo.58.com/visualization/share/13716?api_params=%7B%22appid%22%3A211%2C%22appsign%22%3A%221cfa465e6feedbe1db0b678c6ebba8a0%22%7D&filter_params=%7B%7D&dataset_params=%5B%5D";
                    break;
                case "8":// 930实时累计看板
                    return "https://wuba.xinghuo.58.com/visualization/share/13718?api_params=%7B%22appid%22%3A211%2C%22appsign%22%3A%22bf71a8596e244d5722aab076a6470faa%22%7D&filter_params=%7B%7D&dataset_params=%5B%5D";
                    break;
                case "9":// 930离线累计看板
                    return "https://wuba.xinghuo.58.com/visualization/share/13870?api_params=%7B%22appid%22%3A211%2C%22appsign%22%3A%22f5bf5301efaf0123a4d707abab499eb0%22%7D&filter_params=%7B%7D&dataset_params=%5B%5D";
                    break;
                case "41": // 风控周报-离线任务看板 离线任务报告
                    return "https://wuba.xinghuo.58.com/visualization/share/14458?api_params=%7B%22appid%22%3A211%2C%22appsign%22%3A%228e03c99e202486a3952e724dabb97352%22%7D&filter_params=%7B%7D&dataset_params=%5B%5D";
                    break;
                case "61": // 客户数据中心-客户数据看板
                    return "https://wuba.xinghuo.58.com/visualization/share/14480?api_params=%7B%22appid%22%3A211%2C%22appsign%22%3A%22302a1b833e66114d5031f1800a74eec4%22%7D&filter_params=%7B%7D&dataset_params=%5B%5D";
                    break;

                case "71": // 客户画像
                    return "https://wuba.xinghuo.58.com/visualization/share/14481?api_params=%7B%22appid%22%3A211%2C%22appsign%22%3A%2280c7a8e619810c148739ec6d5a880ebf%22%7D&filter_params=%7B%7D&dataset_params=%5B%5D";
                    break;
                default:
                    return "https://wuba.xinghuo.58.com/visualization/share/"+id;
                    break;
            }
            return location + url;
        };
        vm.p.url = idxUrl(id);
        console.log(vm.p.url);
    };
    $scope.loadUrl(vm.p.id);
}]);


/* Services */
app.service('xinghuoKanbanService', ['ajaxService', function (ajaxService) {

}]);


